package com.hawk.eye.server.convert;

import com.hawk.eye.server.domain.dto.req.RepairApiReqDTO;
import com.hawk.eye.server.domain.dto.req.RepairProblemReqDTO;
import com.hawk.eye.server.domain.dto.resp.ProblemRecordRespDTO;
import com.hawk.eye.server.domain.dto.resp.RepairApiParamRespDTO;
import com.hawk.eye.server.domain.dto.resp.RepairApiRespDTO;
import com.hawk.eye.server.domain.dto.resp.RepairToProblemRespDTO;
import com.hawk.eye.server.domain.po.ProblemRecord;
import com.hawk.eye.server.domain.po.RepairApi;
import com.hawk.eye.server.domain.po.RepairToProblem;
import com.hawk.eye.server.domain.vo.req.RepairApiReqVO;
import com.hawk.eye.server.domain.vo.req.RepairProblemReqVO;
import com.hawk.eye.server.domain.vo.resp.RepairApiParamRespVO;
import com.hawk.eye.server.domain.vo.resp.RepairApiRespVO;
import org.mapstruct.IterableMapping;
import org.mapstruct.Mapper;
import org.mapstruct.Named;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @author zd
 */
@Mapper
public interface RepairApiConvert {

    RepairApiConvert INSTANCE = Mappers.getMapper(RepairApiConvert.class);

    RepairApiReqDTO to(RepairApiReqVO reqVO);

    RepairProblemReqDTO to(RepairProblemReqVO reqVO);

    RepairApiRespVO to(RepairApiRespDTO repairApiRespDTO);

    RepairApiParamRespVO to2(RepairApiParamRespDTO repairApiRespDTO);

    RepairApiRespDTO to(RepairApi repairApi);


    RepairApi to(RepairApiReqDTO reqDTO);

    @IterableMapping(qualifiedByName = "repairToLogToRespDto")
    List<RepairToProblemRespDTO> to(List<RepairToProblem> repairToProblems);

    @Named(value = "repairToLogToRespDto")
    RepairToProblemRespDTO to(RepairToProblem repairToProblem);

    @Named(value = "to2")
    ProblemRecordRespDTO to2(ProblemRecord problemRecord);

    @IterableMapping(qualifiedByName = "to2")
    List<ProblemRecordRespDTO> to3(List<ProblemRecord> problemRecord);


}